#ifndef ENGINE_H
#define ENGINE_H

#include "GL/glew.h"
#include "Scene.h"
#include "Common/Output.h"

class Engine
{
public:
	Engine(void);
	virtual ~Engine(void);
	void Init();
	void Update(float aElapsedTime);
	void SetViewPortMat(const Matrix* aProjMat);
	GLuint LoadShaders(const char * vertex_file_path,const char * fragment_file_path);

	inline void ToggleTransposeMatrix();
	inline bool IsTransposeMatrix();

	static inline GLuint GetUniform(GLuint aProgramID, const char * aUniform);

	Scene* GetScene() { return mScene; }

private:

	//GLuint mVertexArrayID;
	GLuint mProgramID;
	GLuint mUniform1;

	Scene* mScene;

	bool mTransposeMatrix;
};

GLuint Engine::GetUniform(GLuint aProgramID, const char * aUniform)
{
	GLuint tUniform1 = glGetUniformLocation(aProgramID, aUniform);
	if(tUniform1 == 0xFFFFFFFF)
	{
		Output::Print("Uniform Error !!");
	}
	return tUniform1;
}


inline void Engine::ToggleTransposeMatrix()
{
	mTransposeMatrix = !mTransposeMatrix;
}

inline bool Engine::IsTransposeMatrix()
{
	return mTransposeMatrix;
}

#endif // ENGINE_H


